package main

import (
	"fmt"
	"math/rand"
	"sync"
)

type Animal interface {
	SetName(name string) string
}

type Dog struct {
}

func (d *Dog) SetName(name string) string {
	return "dog:" + name
}

func live() *Dog {
	var dog *Dog
	return dog
}
func main() {
	ch := make(chan int)

	var wg sync.WaitGroup
	wg.Add(5)
	go func() {
		defer close(ch)
		for i := 0; i < 5; i++ {
			ch <- rand.Intn(100)
		}

	}()
	go func() {
		for {
			select {
			case v, ok := <-ch:
				if ok {
					fmt.Println("v:", v)
					wg.Done()
				}
			}
		}
	}()
	wg.Wait()
	fmt.Println("main....")
}
